package com.agentframework.core.agent;

/**
 * @author wangjun
 **/
public final class AgentHolder {

    private static final ThreadLocal<Agent> AGENT_HOLDER = new InheritableThreadLocal<>();

    public static void setAgent(Agent agent) {
        AGENT_HOLDER.set(agent);
    }

    public static Agent getAgent() {
        return AGENT_HOLDER.get();
    }

    public static void clear() {
        AGENT_HOLDER.remove();
    }

}
